from typing import Generic, TypeVar, get_origin, get_args

T = TypeVar('T')

class Base(Generic[T]):
    tableid = 1
    pass

class Derived(Base[int]):
    def get_generic_info(self):
        # 获取原始基类
        origin_base = get_origin(self.__class__.__orig_bases__[0])
        # 获取类型参数
        args = get_args(self.__class__.__orig_bases__[0])
        print(f"Origin: {origin_base.__dict__}")
        print(f"Arguments: {args}")
        print(self.__class__.__orig_bases__)

# 创建子类实例并调用方法
derived_instance = Derived()
derived_instance.get_generic_info()